const fs = require("fs");
const path = require("path");

// const TARGET_DIR = '/Users/kc-yu/project/sfh-invoice/src/main/resources/static'
const TARGET_DIR = "D:\\2023-extend\\sfh-invoice\\src\\main\\resources\\static";

const mvToJava = () => {
  // 先删除目标文件夹里的内容
  if (fs.existsSync(TARGET_DIR)) fs.rmdirSync(TARGET_DIR, { recursive: true });
  // 创建文件夹
  fs.mkdirSync(TARGET_DIR, { recursive: true });
  // 移动dist目录的文件以及文件夹到目标文件夹
  const distDir = path.resolve(__dirname, "../dist");
  fs.cpSync(distDir, TARGET_DIR, { recursive: true });
};

mvToJava();
